<%@page import="ext.workflow.WorkFlowUtil"%>
<%@ page import="wt.method.RemoteMethodServer,
	                 java.util.*,
					 java.lang.*,
					 wt.project.*,
					 wt.org.*"%>

<%
	
	response.setCharacterEncoding("UTF-8");
	String oid = request.getParameter("oid");
	
	String roleValue = request.getParameter("rolevalue");

	Role theRole = Role.toRole(roleValue);
	ArrayList member  = new ArrayList (); 
	WTUser user = null;
	String getPrint = new String("<select id='groupMember' multiple='false' style='width:140px; height:200px'>");
    String allList = new String("");
	String fullName = new String("");

	RemoteMethodServer rms = RemoteMethodServer.getDefault();

	Class[] rmiArgTypes = new Class[1];
	rmiArgTypes[0] =  java.lang.String.class;

	Object[] rmiArgs = new Object[1];
	rmiArgs[0] = oid;
	Map map = (Map)rms.invoke("getRoleAndUserByContainer",ext.workflow.WorkFlowUtil.class.getName(),null,rmiArgTypes,rmiArgs);
	
    if(map != null)
	{
	    member = (ArrayList) map.get(theRole);
		for(int i=0;i<member.size();i++)
		{
			user  = (WTUser)member.get(i);
			allList = user.getName();
			fullName = user.getFullName();
			getPrint = getPrint+"<option value='"+allList+"'>"+fullName+"("+allList+")</option>";

		}
		getPrint = getPrint+"</select>";
		out.clear();
		out.println(getPrint);

	}
%>